import React, { useState } from 'react';
import { Button, Divider, Modal, Popover } from 'antd'


import moment from 'moment'

import styles from '../index.module.less'

const PopoverItem: React.FC = ({
  data,
  content
}) => {

  const [open, setOpen] = useState(false);

  const hide = () => {
    setOpen(false);
  };

  const handleOpenChange = (newOpen: boolean) => {
    setOpen(newOpen);
  };



  return (
    <>
      {/* <Popover
        content={
          <div className={styles.popoverWrap}>
            {
              content
            }
          </div>
        }
        zIndex={998}
        placement="left"
        title={data?.label}
        trigger="click"
        open={open}
        onOpenChange={handleOpenChange}
      >
        <Button className="commonOk commonOkDef" >
          {
            data?.label
          }
        </Button>
      </Popover> */}
     
       <Button className="commonOk commonOkDef" onClick={()=>setOpen(true)}>
          {
            data?.label
          }
        </Button>
      <Modal title={data?.label} open={open} onCancel={()=>setOpen(false)} width={900} 
        footer={[
          <Button key="back" type='primary' onClick={()=>setOpen(false)}>
            关闭
          </Button>,]}>
          <div className={styles.popoverWrap}>
            {
              content
            }
          </div>
      </Modal>
    </>
  );
};
export default PopoverItem;

